# gets all Symbols of a group
# retrieves bars from before and after for indicators to settle
getSymbolsGroup <- function(groupcode, daysbefore=40, daysafter=20) {
  symbols <- getDBGroup(groupcode)
  # delivers: symbols['stock_id'] ['from'] ['to']
  
  code <- c()
  symdim <- dim(symbols)
  
  for (i in 1:symdim[1]) {
    symid <- symbols[i,"stock_id"]
    
    # manipulate from date
    if (is.na(symbols[i,"from"])) {
      retrievefrom = NULL
    } else {
      retrievefrom = as.POSIXct(symbols[i,"from"]) - daysbefore*86400
    }
    
    # manipulate to date
    if (is.na(symbols[i,"to"])) {
      retrieveto = NULL
    } else {
      retrieveto = as.POSIXct(symbols[i,"to"]) + daysafter*86400
    }
    cstring <- getSymbols(as.character(symid), src="vadbID", datefrom=retrievefrom, dateto=retrieveto)
    code <- c(code, cstring)
  }
  return (code)
}